//Jairo Bonanata 4.179.044-6
//Rodrigo Stecanella 4.388.511-8
//Pedro Osimani 3.963.430-1
package solfinds;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {    
    public static void main(String[] args) throws IOException {
        int n;
        String buffer;
        System.out.print("Digite parte a ejecutar b|c: ");
        char opcion = (char) System.in.read();
        buffer = new BufferedReader(new InputStreamReader(System.in)).readLine();
        if (opcion == 'b'){
            Finds hipotesis = new Finds();
            System.out.print("Ingrese cantidad de entrenamientos: ");
            buffer = new BufferedReader(new InputStreamReader(System.in)).readLine();
            n = Integer.parseInt(buffer);
            for (int i = 0; i < n; i++){
                System.out.print("Escriba el entrnamiento en la forma Dedicacion,Dificultad,Horario,Humedad,HumorDoc: ");
                buffer = new BufferedReader(new InputStreamReader(System.in)).readLine();
                String [] instancia = new String [5];
                instancia = buffer.split(",");
                hipotesis.appendInstancia(instancia);
            }
            System.out.print("Hipotesis: ");
            hipotesis.mostrar();
        }
        else if (opcion == 'c'){
            String[] inst;
            System.out.print("Ingrese la cantidad de iteraciones: ");
            buffer = new BufferedReader(new InputStreamReader(System.in)).readLine();
            n = Integer.parseInt(buffer);
            int cont;
            int total = 0;
            for (int i = 0; i < n; i++){
                Finds hip = new Finds();
                cont = 0;
                while (!hip.esConcepto()){
                    inst = hip.generarInstancia();
                    hip.appendInstancia(inst);
                    cont ++;
                }
                total = total + cont;
            }
            System.out.print("El promedio es: ");
            System.out.println(total/n);
        }
    }
}
